package com.lagou.service.impl;

import com.lagou.dao.EmployeeDao;
import com.lagou.domain.Employee;
import com.lagou.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional  //对该类启用事务管理
public class EmployeeServiceImpl implements EmployeeService {


    @Autowired
    private EmployeeDao employeeDao;

    @Override
    public void save(Employee employee) {
        employeeDao.save(employee);
    }

    @Override
    public List<Employee> findAll() {
        List<Employee> all = employeeDao.findAll();
        return all;
    }

    @Override
    public void deleteBatch(Integer[] ids) {
        employeeDao.deleteBatch(ids);
    }



}
